package POJ_3187;

import java.util.Scanner;

public class Main {
	static int N;
	static int[] coefficents;
	static int[] nums;
	static boolean[] used;
	static boolean isFound = false;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int sum;

		N = scanner.nextInt();
		sum = scanner.nextInt();
		scanner.close();

		if (N == 0) {
			System.out.println(-1);
		}

		coefficents = new int[N];
		nums = new int[N];
		used = new boolean[N];

		coefficents[0] = 1;
		for (int i = 1; i < coefficents.length; i++) {
			coefficents[i] = coefficents[i - 1] * (N - i) / i;
		}
		DFS(0, sum);
	}

	static void DFS(int i, int sum) {
		if (isFound == true) {
			return;
		} else if (i == N) {
			if (sum == 0) {
				isFound = true;
				for (int j = 0; j < nums.length; j++) {
					System.out.print(nums[j]);
					if (j < nums.length - 1) {
						System.out.print(" ");
					}
				}
				System.out.println();
			}
			return;
		} else if (sum < 0) {
			return;
		} else {
			for (int j = 0; j < nums.length; j++) {
				if (!used[j]) {
					nums[i] = j + 1;
					used[j] = true;
					DFS(i + 1, sum - nums[i] * coefficents[i]);
					used[j] = false;
				}
			}
		}
	}
}